package com.xyp.iodemo.nettyrpccommon.utils;

/**
 * @author xuyuanpeng
 * @version 1.0
 * @date 2019-03-06 14:37
 */
public class XLogUtils {
    private static final String INFO_HEARD="[info]>>>>";
    private static final String ERROR_HEARD="[error]>>>>";

    public static void info(String  param){
        System.out.println(INFO_HEARD+param);
    }

    public static void info(String key,String value){
        System.out.println(INFO_HEARD+key+":"+value);
    }

    public static void error(String  param){
        System.err.println(ERROR_HEARD+param);
    }

    public static void error(String key,String value){
        System.err.println(ERROR_HEARD+key+":"+value);
    }

    public static void info(String[] param){
        if(param.length==0){
            info("参数为空");
        }else if(param.length==1){
            info(param[0]);
        }else {
            info("start print array");
            for (int i = 0; i < param.length; i++) {
                info(param[i]);
            }
            info("end print array");
        }


    }
}
